# =============================================================================
# Try to find the libusb-1.0 library
# =============================================================================

# once done this defines
#
#  LIBUSB1_FOUND          - system has libusb
#  LIBUSB1_INCLUDE_DIRS   - the libusb include directory
#  LIBUSB1_LIBRARIES      - link this to use libusb
#
# REMARK: under Windows, you may need to set the include/link-pathes by hand...

# find include header ...

FIND_PATH(  LIBUSB1_INCLUDE_DIR 
            libusb.h
            PATHS /include
                  /usr/include
                  /usr/local/include
                  ~/include 
            PATH_SUFFIXES libusb-1.0 )

SET( LIBUSB1_INCLUDE_DIRS ${LIBUSB1_INCLUDE_DIR} )

# find link-library
FIND_LIBRARY(   LIBUSB1_LIBRARY 
                NAMES usb-1.0
                PATHS /lib
                      /usr/lib
                      /usr/local/lib
                      ~/lib
                )

SET( LIBUSB1_LIBRARIES ${LIBUSB1_LIBRARY} )

INCLUDE( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS(  LIBUSB1 
                                    LIBUSB1_LIBRARIES 
                                    LIBUSB1_INCLUDE_DIR )

MARK_AS_ADVANCED( LIBUSB1_INCLUDE_DIR LIBUSB1_LIBRARY )

